<?php 
if(!$_SESSION['loginid'] || !$index)
{
    include('404.php');
}
else
{
?>
<center>
    <h2>Mijn Gegevens</h2>
    <?php
    if($_SESSION['leider'])
    {
        $ps = new PreparedStatement("SELECT *, CONCAT(voornaam, ' ', IFNULL(tussenvoegsels, ' '), ' ', achternaam) AS naam FROM leiding LEFT JOIN groepen ON leiding.leidinggroepid = groepen.groepid WHERE leidingid = ?");
        $ps->setInt($_SESSION['leider']);
        $q = $ps->execute();
        $row = mysql_fetch_array($q);
        echo "<table>";
        echo "<tr><td width='140'>Naam:</td><td>{$row['naam']}</td></tr>";
        echo "<tr><td>Groep:</td><td>{$row['groepnaam']}</td></tr>";
        echo "<tr><td>Adres:</td><td>{$row['adres']}</td></tr>";
        echo "<tr><td>Postcode:</td><td>{$row['postcode']}</td></tr>";
        echo "<tr><td>Woonplaats:</td><td>{$row['woonplaats']}</td></tr>";
        echo "<tr><td>E-mail:</td><td>{$row['e-mail']}</td></tr>";
        echo "<tr><td>Telefoon:</td><td>{$row['telefoon']}</td></tr>";
        echo "<tr><td>Mobiel:</td><td>{$row['mobiel']}</td></tr>";
        echo "<tr><td>Geboortedatum:</td><td>{$row['geboortedatum']}</td></tr>";
        echo "</table>";
    }
    ?>
</center>
<?php } ?>
